import type { Metadata } from 'next'; import Link from 'next/link'; import { notFound } from 'next/navigation'; import { PageHeader } from '@/components/ui/page-header'; import { Stat } from '@/components/ui/primitives'; import { AssetBrowser } from '@/components/market/asset-browser'; import { Suspense } from 'react'; import { Skeleton } from '@/components/ui/primitives'; import { getBrandStats } from '@/lib/queries/markets'; import { catName } from '@/lib/taxonomy'; import { fmtMoney, fmtNum } from '@/lib/format'; import type { SP } from '@/lib/search-params'; export const revalidate = 300; export async function generateMetadata({ params }: { params: Promise<{ brand: string }> }): Promise { const { brand } = await params; const name = decodeURIComponent(brand); return { title: `${name} collectibles`, description: `${name}: tracked collectible assets, valuations, sales and listings on RareIndex.` }; } export default async function BrandPage({ params, searchParams }: { params: Promise<{ brand: string }>; searchParams: Promise }) { const { brand } = await params; const sp = await searchParams; const name = decodeURIComponent(brand); const stats = await getBrandStats(name); if (!stats) notFound(); return (
( {catName(c)} ))} />
{[ ['Tracked assets', fmtNum(stats.assets)], ['With valuation', fmtNum(stats.priced)], ['Sales', fmtNum(stats.sales)], ['Active listings', fmtNum(stats.listings)], ['Median RIV', stats.medianRivUsd != null ? fmtMoney(stats.medianRivUsd) : '—'], ['Top RIV', stats.maxRivUsd != null ? fmtMoney(stats.maxRivUsd) : '—'], ].map(([k, v]) => (
))}
}>
); }